package com.eric.service.impl;

import com.eric.bean.CodeBlockDetail;
import com.eric.dao.CodeBlockDetailMapper;
import com.eric.service.CodeBlockDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/3/20.
 */

@Service("CodeBlockDetailService")
public class CodeBlockDetailServiceImpl implements CodeBlockDetailService{

    @Resource
    private CodeBlockDetailMapper codeBlockDetailDao;
    /**
     * 查找
     * @param blockDetailId
     * @return
     */
    @Override
    public CodeBlockDetail getCodeBlockById(int blockDetailId){
        return this.codeBlockDetailDao.selectByPrimaryKey(blockDetailId);
    };

    /**
     * 新增
     * @param blockDetail
     * @return
     */
    @Override
    public int doAdd(CodeBlockDetail blockDetail){
        return this.codeBlockDetailDao.insert(blockDetail);
    };

    /**
     * 删除
     * @param id
     * @return
     */
    @Override
    public int delete(String id){
        return this.codeBlockDetailDao.delete(id);
    };

    /**
     * 修改
     * @param blockDetail
     * @return
     */
    @Override
    public int update(CodeBlockDetail blockDetail){
        return this.codeBlockDetailDao.update(blockDetail);
    };

    @Override
    public List<Map> getList(String blockID){
        return this.getList(blockID);
    };

    @Override
    public int deleteByBlockID(String blockID){
        return this.codeBlockDetailDao.deleteByBlockID(blockID);
    }
}
